package com.hongsheng.mapper;

/*
@Author：郭振文
@Package：com.hongsheng.mapper
@File：AuthorityMapper
@Date：2023/8/11 11:33
*/

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hongsheng.pojo.Authority;
import com.hongsheng.util.AuthoritySqlProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import java.util.List;

@Mapper
public interface AuthorityMapper extends BaseMapper<Authority> {

    //根据roleId查询权限信息
    @Select("select * from tb_authority_role ar,tb_authority a where ar.a_id=a.id and ar.r_id=#{id}")
    List<Authority> selectAuthorityByRoleId(Integer id);

    //查询所有权限信息
    @SelectProvider(type = AuthoritySqlProvider.class,method = "getAuthorityByCondition")
    List<Authority> selectAuthority(@Param("authorityName") String authorityName,
                                    @Param("features") String dfeatures);

    @Select("select * from tb_authority")
    List<Authority> selectAuthority1();




}
